package edu.learn;

import edu.learn.config.SpringConfig;
import edu.learn.entity.Address;
import edu.learn.mapper.AddressMapper;
import edu.learn.service.IAddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

@Slf4j
public class MyApplicationContext  {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        IAddressService addressService = ctx.getBean(IAddressService.class);
        Address address= addressService.findAddressById(1L);
        System.out.println(address.toString());

    }
}
